import {
	request
} from "@/utils/request.js"

export function apiGetBanner() {
	return request({
		url: "/homeBanner"
	})
}

export function apiGetDayRandom() {
	return request({
		url: "/randomWall",
		method: 'get',
	})
}

export function login(data) {
	return request({
		url: "/jeecg-customer/login/customer/login",
		data,
	})
}

export function login4ios(data) {
	return request({
		url: "/jeecg-customer/login/customer/login/4/ios",
		data,
	})
}

export function loginIosCheck(data) {
	return request({
		url: "/jeecg-customer/login/customer/login/ios/check",
		data,
	})
}

// 商品分组 - 查询店铺分组
export function getStoreId(data) {
	return request({
		url: "/jeecg-store/goods/group/query/storeId",
		data,
	})
}

// 商品管理-运营端分页
export function goodsList(data) {
	return request({
		url: "/jeecg-store/goods/group/query/store",
		data,
	})
}

//添加购物车
export function addCart(data) {
	return request({
		url: "/jeecg-customer/cart/addCart",
		data,
	})
}

// 购物车-查询用户店铺购物车
export function queryUserCart(data) {
	return request({
		url: "/jeecg-customer/cart/queryUserCart",
		data,
	})
}

// 修改购物车数量
export function updateCart(data) {
	return request({
		url: "/jeecg-customer/cart/updateCart",
		data,
	})
}

// 修改购物车数量
export function removeCart(data) {
	return request({
		url: "/jeecg-customer/cart/removeCart",
		data,
	})
}

// export function delApi(params) {
// 	return request({
// 		url: '/jeecg-customer/address',
// 		method: 'PUT',
// 		data: params
// 	})
// }

// 商品管理-查询商品详情
export function goodsModel(data) {
	return request({
		url: "/jeecg-store/goods/get/model",
		data,
	})
}

// 美传app-app订单结算页
export function appConfirm(data) {
	return request({
		url: "/jeecg-customer/order/app/confirm",
		data,
	})
}


// 美传app-app提交订单
export function orderSubmit(data) {
	return request({
		url: "/jeecg-customer/order/app/submit",
		data,
	})
}

//管事app-app提交支付订单
export function payAppSubmit(data) {
	return request({
		url: "/jeecg-customer/pay/app/submit",
		data,
	})
}

//美传app-app订单详情
export function orderDetail(id) {
	return request({
		url: `/jeecg-customer/order/app/queryDetail/${id}`,
	})
}

//美传app-app订单确认收货
export function orderReceive(id) {
	return request({
		url: `/jeecg-customer/order/app/orderReceive/${id}`,
	})
}

export const fetchData = (id) => {
	return request({
		url: `/jeecg-customer/order/app/orderReceive/${1}`,
	})
};


//顾客管理-填写邀请码
export function inviteCode(data) {
	return request({
		url: "/jeecg-customer/user/customer/inviteCode",
		data,
	})
}

// 广场添加帖子
export function threadsAdd(data) {
	return request({
		url: "/jeecg-customer/t-forum-threads/add",
		data,
	})
}

// 美传用户端-分页查询广场帖子
export function threadsList(data) {
	return request({
		url: "/jeecg-customer/t-forum-threads/pageQuery",
		data,
	})
}

// 美传用户端-用户关注
export function addCustomerFans(data) {
	return request({
		url: "/jeecg-customer/customer/fans/addCustomerFans",
		data,
	})
}

// 美传用户端-取消关注
export function deleteFavorite(data) {
	return request({
		url: "/jeecg-customer/customer/fans/deleteFavorite",
		data,
	})
}

// 点赞或取消点赞
export function addOrDelete(data) {
	return request({
		url: "/jeecg-customer/t-user-favorite/addOrDelete",
		data,
	})
}


//举报管理-查询举报警告集合
export function queryWaring(data) {
	return request({
		url: "/jeecg-customer/report/query/waring",
		data,
	})
}


// 美传用户端-查询广场帖子详情
export function threadsById(data) {
	return request({
		url: "/jeecg-customer/t-forum-threads/queryById",
		data,
	})
}

// 美传用户端-新增用户评论
export function addComment(data) {
	return request({
		url: "/jeecg-customer/t-comment/addComment",
		data,
	})
}

// 美传用户端-新增用户评论
export function reportSave(data) {
	return request({
		url: "/jeecg-customer/report/save",
		data,
	})
}


// 点赞或取消点赞
export function addLike(data) {
	return request({
		url: "/jeecg-customer/t-user-favorite/addOrDelete",
		data,
	})
}

// 美传用户端-分页查询广场帖子
export function TDetailList(data) {
	return request({
		url: "/jeecg-customer/t-forum-threads/pageQuery",
		data,
	})
}

// 美传用户端-查询用户个人主页粉丝，关注，帖子数量
export function TDetailNum(data) {
	return request({
		url: "/jeecg-customer/t-forum-threads/queryByCustomerId/num",
		data,
	})
}

// 分润管理-客户分润查询
export function getPrize(data) {
	return request({
		url: "/jeecg-customer/orderShare/get/prize",
		data,
	})
}

//美传app-我的主页
export function userDetail(data) {
	return request({
		url: `/jeecg-customer/user/customer/my/homepage?customerId=${data}`,

	})
}

//美传app-app提现记录分页
export function customerTransfer(data) {
	return request({
		url: `/jeecg-customer/customerTransfer/app/page`,
		data,
	})
}


//美传app-用户可提现余额
export function userBalance(data) {
	return request({
		url: `/jeecg-customer/customerTransfer/app/balance`,
		data,
	})
}

//美传app-修改银行卡
export function updateBlankCard(data) {
	return request({
		url: `/jeecg-customer/customerTransfer/app/updateBlankCard`,
		data,
	})
}


//美传app-用户申请提现
export function onTransfer(data) {
	return request({
		url: `/jeecg-customer/customerTransfer/app/transfer`,
		data,
	})
}

//美传app-app提现记录分页
export function customerTransferPage(data) {
	return request({
		url: `/jeecg-customer/customerTransfer/app/page`,
		data,
	})
}

//美传app-app提现记录分页
export function queryByld(id) {
	return request({
		url: `/jeecg-customer/customerBalanceRecord/app/queryList?customerId=${id}`,
	})
}

// 商品管理-生成商品邀请码
export function getCode(data) {
	return request({
		url: `/jeecg-store/goods/get/code?id=${data.id}&storeId=${data.storeId}`,
		method: 'get',
	})
}

// 商品管理-生成商品邀请码
export function getCodeItem(id) {
	return request({
		url: `/jeecg-store/goods/code/goods/${id}`,
		method: 'get',
	})
}

// 顾客管理-设置用户头像昵称
export function setCustomer(data) {
	return request({
		url: `/jeecg-customer/user/customer/set`,
		data,
	})
}

// 顾客管理-设置用户头像昵称
export function storeQRcode(data) {
	return request({
		url: `/jeecg-store/store/qrCode`,
		data,
	})
}

// 顾客管理-注销用户
export function deleteUser(data) {
	return request({
		url: `/jeecg-customer/login/customer/delete`,
		data,
	})
}